<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
    	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>提交质检单</title>
	    <link rel="stylesheet" href="css/AllStyle.css" />
	    <link rel="stylesheet" href="css/iconfont.css" />
	    <script type="text/javascript" src="js/common.js" ></script>
	    <script type="text/javascript" src="js/companydata.js" ></script>
	    <script type="text/javascript" src="js/data.js" ></script>
	    <script type="text/javascript" src="js/tmpl.js" ></script>
	</head>
	<body style="background-color: #ffffff;">
		<!-- 页头 -->
	    <section>
		    <script type="text/javascript">
		        AllPageHeader()
		    </script>
	    </section>

	    <!-- 页面  -->
	    <section class="AllContent">
	    	<form>
	    		<div class="FormStyle">
	    			<ul>
	    				<li>工程名称</li>
	    				<li>
	    					<input id="engineName" disabled/>
	    				</li>
	    				<li>钢号</li>
	    				<li>
	    					<input id="steelSpecification" disabled/>
	    				</li>
	    				<li>规格</li>
	    				<li>
	    					<input id="standard" disabled/>
	    				</li>
	    				<li>材质</li>
	    				<li>
	    					<input id="qualit" disabled/>
	    				</li>
	    				<li>图号</li>
	    				<li>
	    					<input id="figureNumber" disabled/>
	    				</li>
	    				<li>版次</li>
	    				<li>
	    					<input id="version" disabled/>
	    				</li>
	    				<li>位置</li>
	    				<li>
	    					<input id="location" disabled/>
	    				</li>
	    				<li>单个重量(KG)</li>
	    				<li>
	    					<input id="singleWeight" disabled/>
	    				</li>
	    				<li>单个长度(m)</li>
	    				<li>
	    					<input id="singleLenght" disabled/>
	    				</li>
	    				<li>数量</li>
	    				<li>
	    					<input id="count" disabled/>
	    				</li>
	    			</ul>
	    		</div>
			</form>
			<div id="taskDetail" style="margin: 10px;">
				<div class="StockNav"></div>
			</div>
		</section>
	</body>

	<script src="js/mui.min.js"></script>
	<script src="js/jquery.min.js"></script>
	<script src="js/common.js"></script>
	<script src="js/data.js"></script>
	<script type="text/javascript">
		var sData;
		mui.init();
		$('.AllHeader li:eq(1)').text('构件详情')

		//添加refresh自定义事件监听
		window.addEventListener('frame',function(){
			var id = event.detail.id;
			alertMessage(id);
		});

		$(function(){
			if(getCookie("token") === null || getCookie("token") === ''){
				window.location.href='login.html';
				return;
			}
			$.ajax({
				headers:{
					"X-Access-Token":getCookie("token")
				},
				type: "GET",
				url: getServerUrl()+"/frame/findById?id="+$_GET['id'], //与此php页
				dataType: 'json', //从php返回的值以 JSON方式 解释
				contentType: 'application/json',
				success: function (json) {//如果调用php成功
					$('#engineName').val(json.engineName);
					$('#steelSpecification').val(json.steelSpecification);
					$('#standard').val(json.standard);
					$('#qualit').val(json.qualit);
					$('#figureNumber').val(json.figureNumber);
					$('#version').val(json.version);
					$('#location').val(json.location);
					$('#singleWeight').val(json.singleWeight);
					$('#singleLenght').val(json.singleLenght);
					$('#count').val(json.count);
					if(json.tasks!=null && json.tasks.length >0){
						let content = '';
						$('.StockNav').html('');
						for(var i =0;i<json.tasks.length;i++){
							content = '<div class="mui-card" style="margin-top: 10px;">' +
										'<div class="mui-card-header" style="padding: 10px;font-size: 20px;background-color: #00a9ed;color: #ffffff">任务单号：'+ json.tasks[i].taskNo +'</div>' +
										'<div class="mui-card-content">'
											+'<ul>'
												+'<li>工序名称</li><li>'+ json.tasks[i].procName +'</li>'
											+'</ul>'
											+'<ul>'
												+'<li>报工数量</li><li>'+ json.tasks[i].reportCount +'</li>'
											+'</ul>'
											+'<ul>'
												+'<li>在制数量</li><li>' + json.tasks[i].inProcCount + '</li>'
											+'</ul>'
											+'<ul>'
												+'<li>合格数量</li><li>' + json.tasks[i].eligibilityCount + '</li>'
											+'</ul>'+
										'</div>' +
										'<div class="mui-card-footer"></div>'
            			            +'</div>';
							$('.StockNav').append(content);
						}

					}
				},
				error:function(json){
					window.location.href='login.html';
				}
			});
		});
	</script>
	<style>
		input{
			background:transparent;
			color:#aaa;
			border:1px solid #aaa;
		}
		.mui-card{overflow:hidden;margin:0 15px;border:1px solid #ddd;border-radius:6px;background-color:#fff;background-clip:padding-box}
		.mui-content>.mui-card:first-child{margin-top:15px}
	</style>
</html>
